import React from 'react';
import { Router, Route, Switch, Redirect } from 'dva/router';
import IndexPage from './routes/Index/IndexPage';
import Home from './routes/Home/Home';

function RouterConfig({ history }) {
  return (
    /* <Route path="/" exact component={IndexPage} /> */
    <Router history={history}>
      <Switch>
        <IndexPage path='/' component={IndexPage}>
          <Route path="/home" exact component={Home} />
          <Route exact path='/' render={()=>(<Redirect to='/home' />)} />
        </IndexPage>
      </Switch>
    </Router>
  );
}

export default RouterConfig;
